package com.zhuojy.equity.mall.admin.web.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zhuojy.equity.mall.admin.common.entity.Notice;
import com.zhuojy.equity.mall.admin.common.entity.Notice2;
import com.zhuojy.equity.mall.admin.common.pojo.ResultEntity;
import com.zhuojy.equity.mall.admin.service.NoticeService;
import com.zhuojy.equity.mall.admin.service.NoticeService2;
import io.swagger.annotations.Api;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@CrossOrigin
@RequestMapping("notice2")
@RequiredArgsConstructor
@Api("信息公告")
public class NoticeController2 {
    @Autowired
    private NoticeService2 noticeService2;
    //查询
    @RequestMapping("queryNotice2")
    public ResultEntity queryNotice2(@RequestBody Notice2 notice2) {
        try {
            IPage page = noticeService2.queryNotice2(notice2);
            return ResultEntity.OK(page);
        } catch (Exception e) {
            e.printStackTrace();
            return ResultEntity.ERROR("操作错误");
        }
    }
}
